const Token = 'token'

export const setToken = (token: string) => {
  localStorage.setItem(Token, token)
}

export const getToken = () => {
  return localStorage.getItem(Token)
}

export const removeToken = () => {
  localStorage.removeItem(Token)
}

const userInfo = 'userInfo'

export const setUserInfo = (userInfo: any) => {
  localStorage.setItem(userInfo, JSON.stringify(userInfo))
}

export const getUserInfo = () => {
  return JSON.parse(localStorage.getItem(userInfo) || '{}')
}

export const removeUserInfo = () => {
  localStorage.removeItem(userInfo)
}
